/* This file is part of 34S.
 * 
 * 34S is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * 34S is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with 34S.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <stdio.h>

static const char *x20[10] = {
	"0.0765265211334973337546404",
	"0.2277858511416450780804962",
	"0.3737060887154195606725482",
	"0.5108670019508270980043641",
	"0.6360536807265150254528367",
	"0.7463319064601507926143051",
	"0.8391169718222188233945291",
	"0.9122344282513259058677524",
	"0.9639719272779137912676661",
	"0.9931285991850949247861224"
};
static const char *w20[10] = {
	"0.1527533871307258506980843",
	"0.1491729864726037467878287",
	"0.1420961093183820513292983",
	"0.1316886384491766268984945",
	"0.1181945319615184173123774",
	"0.1019301198172404350367501",
	"0.0832767415767047487247581",
	"0.0626720483341090635695065",
	"0.0406014298003869413310400",
	"0.0176140071391521183118620"
};

static const char *x12[6] = {
	"0.1252334085114689154724414",
	"0.3678314989981801937526915",
	"0.5873179542866174472967024",
	"0.7699026741943046870368938",
	"0.9041172563704748566784659",
	"0.9815606342467192506905491"
};
static const char *w12[6] = {
	"0.2491470458134027850005624",
	"0.2334925365383548087608499",
	"0.2031674267230659217490645",
	"0.1600783285433462263346525",
	"0.1069393259953184309602547",
	"0.0471753363865118271946160"
};
	
/* n = 9 */
static const char *x9[5] = {
	"0.0000000000000000000000000",
	"0.3242534234038089290385380",
	"0.6133714327005903973087020",
	"0.8360311073266357942994298",
	"0.9681602395076260898355762"
};
static const char *w9[5] = {
	"0.3302393550012597631645251",
	"0.3123470770400028400686304",
	"0.2606106964029354623187429",
	"0.1806481606948574040584720",
	"0.0812743883615744119718922"
};

/* n = 11 */
static const char *x11[6] = {
	"0.0000000000000000000000000",
	"0.2695431559523449723315320",
	"0.5190961292068118159257257",
	"0.7301520055740493240934163",
	"0.8870625997680952990751578",
	"0.9782286581460569928039380"
};
static const char *w11[6] = {
	"0.2729250867779006307144835",
	"0.2628045445102466621806889",
	"0.2331937645919904799185237",
	"0.1862902109277342514260976",
	"0.1255803694649046246346943",
	"0.0556685671161736664827537"
};

static void dump(int n, const char **x, const char **w) {
	int i;

	for (i=0; i<(n+1)/2; i++) {
		printf("\t{ \"gl%d_%d_x\", \"GL%d_%d_X\", \"%s\" },\n",
				n, i, n, i, x[i], w[i]);
		printf("\t{ \"gl%d_%d_w\", \"GL%d_%d_W\", \"%s\" },\n",
				n, i, n, i, w[i]);
	}
	printf("\n");
}

int main(int argc, char *argv[]) {
	dump(20, x20, w20);
	dump(12, x12, w12);
	dump(11, x11, w11);
	dump(9, x9, w9);
	return 0;
}
